package com.dana.system.domain.es;


import lombok.Getter;
import lombok.Setter;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.time.LocalDateTime;

@Getter
@Setter
@Document(indexName = "idx_question")
public class QuestionES {
    /**
     * 题目id,
     */
    @Id
    @Field(type = FieldType.Long)
    private Long questionId;

    /**
     * 标题
     */
    @Field(type = FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    private String title;

    /**
     * 题目难度 1-简单 2-中等 3-困难
     */
    @Field(type = FieldType.Byte)
    private int difficulty;

    /**
     * 时间限制
     */
    @Field(type = FieldType.Long)
    private int timeLimit;

    /**
     * 空间限制
     */
    @Field(type = FieldType.Long)
    private int spaceLimit;

    /**
     * 题目内容
     */
    @Field(type = FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    private String content;

    /**
     * 测试用例
     */
    @Field(type = FieldType.Text)
    private String questionCase;

    /**
     * defaultCode默认代码块
     */
    @Field(type = FieldType.Text)
    private String defaultCode;

    /**
     * main函数
     */
    @Field(type = FieldType.Text)
    private String mainFuc;

    @Field(type = FieldType.Date,format = DateFormat.date_hour_minute_second)
    private LocalDateTime createTime;
}
